//
//  SaPublicWay.h
//  saas
//
//  Created by fangyibao on 2020/7/27.
//  Copyright © 2020 fangmao. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface SaPublicWay : NSObject

+(NSString*)changeNumberFormatter:(NSString*)str;

/**
 * 将图片缩放到指定的CGSize大小
 * UIImage image 原始的图片
 * CGSize size 要缩放到的大小
 */
+(UIImage*)image:(UIImage *)image scaleToSize:(CGSize)size;

/**
 * 从图片中按指定的位置大小截取图片的一部分
 * UIImage image 原始的图片
 * CGRect rect 要截取的区域
 */
+(UIImage *)imageFromImage:(UIImage *)image inRect:(CGRect)rect;


+(UIImage *)cropSquareImage:(UIImage *)image;

/* 挑房咖 */
+(NSString *)InputContentType:(NSString *)type;

//+ (BOOL)openWechatMinPraogramWithUserName:(NSString *)userName path:(NSString *)path miniProgramType:(WXMiniProgramType)miniProgramType;

+(void)copyWeixinByWechatNickName:(NSString *)nickname;

+(NSAttributedString *)generateAttrbuteString:(NSString *)first Color:(UIColor *)color Font:(UIFont *)font count:(NSString *)count;
+(NSString *)inputMonthStr;


// 保存到相册
+(void)transformViewBecomeImg:(UIView *)view;
// 生成图片
+(UIImage *)shareImageByView:(UIView *)view;

//富文本 显示不同的颜色
+(NSMutableAttributedString *)getPriceAttribute:(NSString *)string length:(NSInteger)lenght Font:(UIFont *)font Color:(UIColor *)color;

+(NSString *)getNowTimeTimestamp3;

// 根据后台返回的时间  显示“刚刚” “xx小时”等
+(NSString *)inputDateStr:(NSString *)str;

/*
 给图片加上水印
 originImage ***** 为原图片
 waterText *****  水印文字
 
*/
+(UIImage *)addWatermarketWithOriginImage:(UIImage *)originImage WaterText:(NSString *)waterText;

/* 二手房  排序 */
+(NSMutableDictionary *)inputOldHouseSortData:(NSInteger)index;

+(NSMutableDictionary *)inputLeaseSortData:(NSInteger)index; // 租赁

// 将字符串转成 万 百万 千万 亿
+(NSString *)getDealNumwithstring:(NSString *)string;

// 电话 344显示
+(NSString *)cellPhoneAddString:(NSString *)string;



@end


NS_ASSUME_NONNULL_END
